#include "dao.h"
#include <iostream>
#include <fstream>

Dao::Dao() {}

json Dao::getJson(std::string fileName) {
    json fileList;
    // 从文件读取JSON
    std::ifstream file(fileName);
    if (!file.is_open()) {
        std::cerr << "无法打开文件" << std::endl;
    }
    try {
        fileList = json::parse(file);
    }
    catch (const std::exception& e) {
        std::cerr << "JSON parse error: " << fileName << e.what() << std::endl;
    }
    file.close();
    return fileList;
}
